package io

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
	"strings"
)

//1 5
//10 20
func main() {
	for {
		a, b := 0, 0
		n, _ := fmt.Scan(&a, &b)
		if n > 0 {
			fmt.Println(a + b)
		} else {
			break
		}
	}
}

//2
//1 5
//10 20
func main() {
	i := 0
	fmt.Scan(&i)
	for j := 0; j < i; j++ {
		a, b := 0, 0
		fmt.Scan(&a, &b)
		fmt.Println(a + b)
	}
}

//1 5
//10 20
//0 0
func main() {
	for {
		a, b := 0, 0
		fmt.Scan(&a, &b)
		if a == 0 && b == 0 {
			break
		}
		fmt.Println(a + b)
	}
}

//4 1 2 3 4
//5 1 2 3 4 5
//0
func main() {
	for {
		n := 0
		fmt.Scan(&n)
		if n == 0 {
			break
		}
		sum := 0
		for j := 0; j < n; j++ {
			a := 0
			fmt.Scan(&a)
			sum += a
		}
		fmt.Println(sum)
	}
}

//2
//4 1 2 3 4
//5 1 2 3 4 5
func main() {
	i := 0
	fmt.Scan(&i)
	for j := 0; j < i; j++ {
		n := 0
		fmt.Scan(&n)
		sum := 0
		for j := 0; j < n; j++ {
			a := 0
			fmt.Scan(&a)
			sum += a
		}
		fmt.Println(sum)
	}
}

//4 1 2 3 4
//5 1 2 3 4 5
func main() {
	for {
		i := 0
		n, _ := fmt.Scan(&i)
		if n > 0 {
			sum := 0
			for j := 0; j < i; j++ {
				a := 0
				fmt.Scan(&a)
				sum += a

			}
			fmt.Println(sum)
		} else {
			break
		}
	}
}

//1 2 3
//4 5
//0 0 0 0 0
func main() {
	input := bufio.NewScanner(os.Stdin)
	for input.Scan() {
		s := input.Text()
		nums := strings.Fields(s)
		sum := 0
		for _, num := range nums {
			n, _ := strconv.Atoi(num)
			sum += n
		}
		fmt.Println(sum)
	}
}

//5
//c d a bb e
func main() {
	i := 0
	fmt.Scan(&i)
	ss := []string{}
	for j := 0; j < i; j++ {
		s := ""
		fmt.Scan(&s)
		ss = append(ss, s)
		sort.Slice(ss, func(i, j int) bool {
			for k := 0; k < len(ss[i]) && k < len(ss[j]); k++ {
				if ss[i][k] != ss[j][k] {
					return ss[i][k] < ss[j][k]
				}
			}
			return true
		})
	}
	for i := range ss {
		fmt.Print(ss[i] + " ")
	}
}
//a c bb
//f dddd
//nowcoder
func main() {
	input := bufio.NewScanner(os.Stdin)
	for input.Scan() {
		ss := strings.Fields(input.Text())
		sort.Slice(ss, func(i, j int) bool {
			for k := 0; k < len(ss[i]) && k < len(ss[j]); k++ {
				if ss[i][k] != ss[j][k] {
					return ss[i][k] < ss[j][k]
				}
			}
			return true
		})
		for i := range ss {
			if i == len(ss)-1 {
				fmt.Print(ss[i])
			} else {
				fmt.Print(ss[i] + " ")
			}
		}
		fmt.Println()
	}
}

//a,c,bb
//f,dddd
//nowcoder
func main() {
	input := bufio.NewScanner(os.Stdin)
	for input.Scan() {
		ss := strings.Split(input.Text(), ",")
		sort.Slice(ss, func(i, j int) bool {
			for k := 0; k < len(ss[i]) && k < len(ss[j]); k++ {
				if ss[i][k] != ss[j][k] {
					return ss[i][k] < ss[j][k]
				}
			}
			return true
		})
		for i := range ss {
			if i == len(ss)-1 {
				fmt.Print(ss[i])
			} else {
				fmt.Print(ss[i] + ",")
			}
		}
		fmt.Println()
	}
}
